Example

 

We want to create for handle a the window in figure.

First we must create this resources:

 

 

And the DLOG descriptor 'EdF'

 

Now we must write the code to handle this data.

/***
 *

run();
 *
 *

Handle the Dialog of the example. 
 *

(exampleDialog = 132, exampleDLOGDescr = 132)
 *
 ***/
void Example::run(void)

DialogPtr

exampleDialog;

CgestisciDLOGDati
exampleDLOG;

EventRecord

event;

short

itemHit, pos;

Boolean

status;

exampleDialog = GetNewDialog(exampleDLOGID, NULL, (WindowPtr)-1L);

if (exampleDialog != NULL && 

!exampleDLOG.IgestisciDLOGDati(exampleDialog, exampleDLOGDescr))

exampleDLOG.disableAboutDLOG = true;

 
do

 

exampleDLOG.idle();

 

GetNextEvent(everyEvent, &event);

 

itemHit = exampleDLOG.gestEvent(&event);

 

if (itemHit == -1 && IsDialogEvent(&event))

 

 

DialogSelect(&event, &helpDialog, &itemHit);

 

exampleDLOG.itemSelect(&event, itemHit, &pos, &status);

 

 

if (itemHit == okexampleDLOGitem)

break;

 

 

while(true);

 

exampleDLOG.Dispose();

 DisposDialog(exampleDialog);

else if (exampleDialog != NULL)

 

DisposDialog(exampleDialog);